package com.jirong.shop.controller;


import com.jirong.shop.pojo.TUser;
import com.jirong.shop.service.TOrderService;
import com.jirong.shop.vo.OrderDetailVo;
import com.jirong.shop.vo.RespBean;
import com.jirong.shop.vo.RespBeanEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jirong
 * @since 2022-01-16
 */
@RestController
@RequestMapping("/order")
public class TOrderController {
    @Autowired
    private TOrderService orderService;
    @RequestMapping("/detail")
    public RespBean detail(TUser user, Long orderId){
        if (null==user){
            return RespBean.error(RespBeanEnum.SESSION_ERROR);
        }
        OrderDetailVo detail = orderService.detail(orderId);
        return RespBean.success(detail);
    }
}

